﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using JESAI.Core.Configuration;

namespace JESAI.Caching.Redis
{
    //[DependsOn(
    //typeof(YiFrameworkCoreModule)
    //)]
    public static class ServiceCollectionExtensions
    {
        public static void UseRedis(this IApplicationBuilder app)
        {
        }

        public static IServiceCollection AddRedis(this IServiceCollection services)
        {
            services.Configure<CachingConnOptions>((CachingConnOptions)=> { Appsettings.appConfiguration("CachingConnOptions"); });
            services.AddSingleton<CacheManager, RedisCacheClient>();

            return services;
        }
    }

}